Optimal. Leaf size=177 \[ \frac{b c-a d}{2 f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}-\frac{2 a c d-b \left (c^2-d^2\right )}{f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}+\frac{\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}+\frac{x \left (a c^3-3 a c d^2+3 b c^2 d-b d^3\right )}{\left (c^2+d^2\right )^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.290842, antiderivative size = 177, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3529, 3531, 3530} \[ \frac{b c-a d}{2 f \left (c^2+d^2\right ) (c+d \tan (e+f x))^2}-\frac{2 a c d-b \left (c^2-d^2\right )}{f \left (c^2+d^2\right )^2 (c+d \tan (e+f x))}+\frac{\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )^3}+\frac{x \left (a c^3-3 a c d^2+3 b c^2 d-b d^3\right )}{\left (c^2+d^2\right )^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3529
Rule 3531
Rule 3530
Rubi steps
\begin{align*} \int \frac{a+b \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx &=\frac{b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac{\int \frac{a c+b d+(b c-a d) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{c^2+d^2}\\ &=\frac{b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac{\int \frac{2 b c d+a \left (c^2-d^2\right )-\left (2 a c d-b \left (c^2-d^2\right )\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^2}\\ &=\frac{\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{\left (c^2+d^2\right )^3}+\frac{b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}+\frac{\left (d \left (2 b c d+a \left (c^2-d^2\right )\right )-c \left (-2 a c d+b \left (c^2-d^2\right )\right )\right ) \int \frac{d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{\left (c^2+d^2\right )^3}\\ &=\frac{\left (a c^3+3 b c^2 d-3 a c d^2-b d^3\right ) x}{\left (c^2+d^2\right )^3}+\frac{\left (a d \left (3 c^2-d^2\right )-b \left (c^3-3 c d^2\right )\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right )^3 f}+\frac{b c-a d}{2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}-\frac{2 a c d-b \left (c^2-d^2\right )}{\left (c^2+d^2\right )^2 f (c+d \tan (e+f x))}\\ \end{align*}
Mathematica [C] time = 4.13314, size = 244, normalized size = 1.38 \[ \frac{(b c-a d) \left (\frac{d \left (\frac{\left (c^2+d^2\right ) \left (5 c^2+4 c d \tan (e+f x)+d^2\right )}{(c+d \tan (e+f x))^2}+\left (2 d^2-6 c^2\right ) \log (c+d \tan (e+f x))\right )}{\left (c^2+d^2\right )^3}+\frac{i \log (-\tan (e+f x)+i)}{(c+i d)^3}-\frac{\log (\tan (e+f x)+i)}{(d+i c)^3}\right )-b \left (\frac{2 d \left (\frac{c^2+d^2}{c+d \tan (e+f x)}-2 c \log (c+d \tan (e+f x))\right )}{\left (c^2+d^2\right )^2}+\frac{i \log (-\tan (e+f x)+i)}{(c+i d)^2}-\frac{i \log (\tan (e+f x)+i)}{(c-i d)^2}\right )}{2 d f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.035, size = 483, normalized size = 2.7 \begin{align*} -{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) a{c}^{2}d}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) a{d}^{3}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) b{c}^{3}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) bc{d}^{2}}{2\,f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) a{c}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-3\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) ac{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+3\,{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) b{c}^{2}d}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{\arctan \left ( \tan \left ( fx+e \right ) \right ) b{d}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+3\,{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) a{c}^{2}d}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) a{d}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) b{c}^{3}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}+3\,{\frac{\ln \left ( c+d\tan \left ( fx+e \right ) \right ) bc{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{3}}}-{\frac{ad}{2\,f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) ^{2}}}+{\frac{bc}{2\,f \left ({c}^{2}+{d}^{2} \right ) \left ( c+d\tan \left ( fx+e \right ) \right ) ^{2}}}-2\,{\frac{acd}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }}+{\frac{b{c}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }}-{\frac{b{d}^{2}}{f \left ({c}^{2}+{d}^{2} \right ) ^{2} \left ( c+d\tan \left ( fx+e \right ) \right ) }} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.71772, size = 433, normalized size = 2.45 \begin{align*} \frac{\frac{2 \,{\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{3 \, b c^{3} - 5 \, a c^{2} d - b c d^{2} - a d^{3} + 2 \,{\left (b c^{2} d - 2 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{c^{6} + 2 \, c^{4} d^{2} + c^{2} d^{4} +{\left (c^{4} d^{2} + 2 \, c^{2} d^{4} + d^{6}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{5} d + 2 \, c^{3} d^{3} + c d^{5}\right )} \tan \left (f x + e\right )}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 1.54457, size = 1038, normalized size = 5.86 \begin{align*} \frac{5 \, b c^{3} d^{2} - 7 \, a c^{2} d^{3} - b c d^{4} - a d^{5} + 2 \,{\left (a c^{5} + 3 \, b c^{4} d - 3 \, a c^{3} d^{2} - b c^{2} d^{3}\right )} f x -{\left (3 \, b c^{3} d^{2} - 5 \, a c^{2} d^{3} - 3 \, b c d^{4} + a d^{5} - 2 \,{\left (a c^{3} d^{2} + 3 \, b c^{2} d^{3} - 3 \, a c d^{4} - b d^{5}\right )} f x\right )} \tan \left (f x + e\right )^{2} -{\left (b c^{5} - 3 \, a c^{4} d - 3 \, b c^{3} d^{2} + a c^{2} d^{3} +{\left (b c^{3} d^{2} - 3 \, a c^{2} d^{3} - 3 \, b c d^{4} + a d^{5}\right )} \tan \left (f x + e\right )^{2} + 2 \,{\left (b c^{4} d - 3 \, a c^{3} d^{2} - 3 \, b c^{2} d^{3} + a c d^{4}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac{d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \,{\left (2 \, b c^{4} d - 3 \, a c^{3} d^{2} - 3 \, b c^{2} d^{3} + 3 \, a c d^{4} + b d^{5} - 2 \,{\left (a c^{4} d + 3 \, b c^{3} d^{2} - 3 \, a c^{2} d^{3} - b c d^{4}\right )} f x\right )} \tan \left (f x + e\right )}{2 \,{\left ({\left (c^{6} d^{2} + 3 \, c^{4} d^{4} + 3 \, c^{2} d^{6} + d^{8}\right )} f \tan \left (f x + e\right )^{2} + 2 \,{\left (c^{7} d + 3 \, c^{5} d^{3} + 3 \, c^{3} d^{5} + c d^{7}\right )} f \tan \left (f x + e\right ) +{\left (c^{8} + 3 \, c^{6} d^{2} + 3 \, c^{4} d^{4} + c^{2} d^{6}\right )} f\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: AttributeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.42768, size = 570, normalized size = 3.22 \begin{align*} \frac{\frac{2 \,{\left (a c^{3} + 3 \, b c^{2} d - 3 \, a c d^{2} - b d^{3}\right )}{\left (f x + e\right )}}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} + \frac{{\left (b c^{3} - 3 \, a c^{2} d - 3 \, b c d^{2} + a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}} - \frac{2 \,{\left (b c^{3} d - 3 \, a c^{2} d^{2} - 3 \, b c d^{3} + a d^{4}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{6} d + 3 \, c^{4} d^{3} + 3 \, c^{2} d^{5} + d^{7}} + \frac{3 \, b c^{3} d^{2} \tan \left (f x + e\right )^{2} - 9 \, a c^{2} d^{3} \tan \left (f x + e\right )^{2} - 9 \, b c d^{4} \tan \left (f x + e\right )^{2} + 3 \, a d^{5} \tan \left (f x + e\right )^{2} + 8 \, b c^{4} d \tan \left (f x + e\right ) - 22 \, a c^{3} d^{2} \tan \left (f x + e\right ) - 18 \, b c^{2} d^{3} \tan \left (f x + e\right ) + 2 \, a c d^{4} \tan \left (f x + e\right ) - 2 \, b d^{5} \tan \left (f x + e\right ) + 6 \, b c^{5} - 14 \, a c^{4} d - 7 \, b c^{3} d^{2} - 3 \, a c^{2} d^{3} - b c d^{4} - a d^{5}}{{\left (c^{6} + 3 \, c^{4} d^{2} + 3 \, c^{2} d^{4} + d^{6}\right )}{\left (d \tan \left (f x + e\right ) + c\right )}^{2}}}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]